<?php

class Login extends Controller {

	// Constructor
	function Login()
    {
       
		parent::Controller();
		
		// load model
		$this->load->model('Df602_model', 'df602', TRUE);
		
		// select table to scaff
		$this->load->scaffolding('realtime');
		
		// load session lib
		$this->load->library('session');
		
		$this->load->helper('form');
    }

	
	function checkLogin()
	{
		include "system/application/config/users.php" ;
		$username = $_POST['username'];
		$password = $_POST['password'];
		foreach($userlist as $user)
		{
			if($username == $user["username"] && $password == $user["password"])
			{
				$this->session->set_userdata('login', TRUE);
				return;
			}
		}
	}
	
	function logOut()
	{
		$this->session->sess_destroy();
	}
}











?>